<template>
  <div id="app">
    <LeftMenu @change="onChange" />
    <!-- <RightPanel v-if="index==0" />
    <Animation v-if="index==1" />
    <Blog v-if="index==2" />
    <FlexDemo v-if="index==3" />-->

    <router-view />
  </div>
</template>

<script>
import LeftMenu from "./components/LeftMenu.vue";
import RightPanel from "./components/RightPanel.vue";
import Animation from "./components/Animation.vue";
import Blog from "./components/Blog.vue";
import FlexDemo from "./components/FlexDemo.vue";
export default {
  name: "App",
  components: {
    LeftMenu,
    RightPanel,
    Animation,
    Blog,
    FlexDemo
  },
  data() {
    return {
      index: 0
    };
  },
  methods: {
    onChange(param) {
      // 通过改变index，来实现右边内容的切换
      this.index = param;
    }
  }
};
</script>

<style>
body {
  margin: 0;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  display: flex;
}
</style>
